﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using RED_NET_Core.BLL;
namespace RED_NET.ContentPage
{
    public partial class RedNetMain : System.Web.UI.Page
    {
        protected int uId;
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            LoginBLL nlogin = new LoginBLL();
            uId = nlogin.GetUserId(userName.Text.Trim(), password.Text.Trim());
            Session["USER_ID"] = uId;
            if (Int32.Parse(Session["USER_ID"].ToString()) == -1)
            {
                Response.Write("<script>alert('帐号或密码错误！');</script>");
            }
            else
            {
                Response.Write("<script>alert('登录成功！');location.href = 'UserIndex.aspx?VISIT_ID=" + uId.ToString() + "';</script>");
            }
        }
    }
}
